

package com.hazelcast.internal.management.events;

import com.hazelcast.internal.json.JsonObject;

import java.util.UUID;

abstract class AbstractWanSyncFinishedEvent extends AbstractWanAntiEntropyEventBase {
    private final int partitionsSynced;
    private final long recordsSynced;
    private final long durationSecs;

    AbstractWanSyncFinishedEvent(UUID uuid, String wanReplicationName, String wanPublisherId, String mapName, long durationSecs, long recordsSynced, int partitionsSynced) {
        super(uuid, wanReplicationName, wanPublisherId, mapName);
        this.durationSecs = durationSecs;
        this.recordsSynced = recordsSynced;
        this.partitionsSynced = partitionsSynced;
    }

    @Override
    public JsonObject toJson() {
        JsonObject json = super.toJson();
        json.add("durationSecs", durationSecs);
        json.add("partitionsSynced", partitionsSynced);
        json.add("recordsSynced", recordsSynced);
        return json;
    }
}
